import * as types from '../mutation-types';
import { typeOf } from 'common/js/utils';
// utils
import { findDeeply } from 'common/js/utils';

export const setProductTree = ({ commit }, productTree) => {
  if (typeOf(productTree) !== 'array') throw new Error('productTree类型不对');
  commit(types.SET_PRODUCT_TREE, productTree);
};

export const setCategory1 = ({ commit }, category) => {
  commit(types.SET_CATEGORY1, category);
};

export const setCategory2 = ({ commit }, category) => {
  commit(types.SET_CATEGORY2, category);
};
